-----------------------------------
-- Area: Xarcabard
-- NPC:  Ereshkigal
-- Custom Biast Fight
-----------------------------------

require("scripts/globals/status");

-----------------------------------
-- onMobInitialize Action
-----------------------------------

function onMobInitialize(mob)

	mob:addStatusEffect(EFFECT_REGAIN,100,3,0);
	mob:SetMobAbilityEnabled(false);
	mob:SetAutoAttackEnabled(false);
	mob:SetMagicCastingEnabled(false);
	printf("Ereshkigal Initialized");

end;

-----------------------------------
-- onMobEngaged
-----------------------------------

function onMobEngaged(mob,target)
	
end;

-----------------------------------
-- onMobFight
-----------------------------------

function onMobFight(mob,target)

	local RandomAttack;
	local AttackNumber;
	
	RandomAttack = math.random();
	if(RandomAttack <= 0.1) then
		AttackNumber = 219; -- Terror Touch
	elseif(RandomAttack <= 0.2) then
		AttackNumber = 218; -- Fear Touch
	elseif(RandomAttack <= 0.3) then
		AttackNumber = 221; -- Dark Sphere
	elseif(RandomAttack <= 0.4) then
		AttackNumber = 217; -- Ectosmash
	elseif(RandomAttack <= 0.5) then
		AttackNumber = 220; -- Curse
	else
		AttackNumber = 216; -- Grave Reel
	end
	mob:useMobAbility(AttackNumber);
	printf("Ereshkigal used ability %u RA: %1.2f",AttackNumber,RandomAttack);

end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
--printf("updateCSID: %u",csid);
--printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
--printf("finishCSID: %u",csid);
--printf("RESULT: %u",option);
end;